<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="div1">
			<img src="img/1.jpg" id="source" >
		</div>
		<button type="button" onclick="kaishi()">开始</button>
	</body>
	<script type="text/javascript">
		function kaishi(){
			var arr=["img/1.jpg","img/2.jpg","img/3.jpg","img/4.jpg","img/5.jpg","img/6.jpg","img/7.jpg","img/8.jpg","img/9.jpg"];
			var index = 0;
			setInterval(function(){	
				if(index == arr.length) ;
				document.getElementById("source").setAttribute("src",arr[index]);
				console.log(index)
				index++;
			},300)
				
				// console.log(arr[i]);
			
		}
	</script>
</html>
